package com.hmall.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hmall.client.FeignClient;
import com.hmall.common.dto.PageDTO;
import com.hmall.mapper.SearchMapper;
import com.hmall.pojo.ItemCondition;
import com.hmall.pojo.ItemConditionVo;
import com.hmall.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author 22096
* @description 针对表【tb_item(商品表)】的数据库操作Service实现
* @createDate 2024-11-15 09:13:04
*/
@Service
public class SearchServiceImpl extends ServiceImpl<SearchMapper,ItemCondition>
    implements SearchService{

    @Autowired
    private FeignClient feignClient;

    @Override
    public ItemConditionVo getBrandAndCategory(ItemCondition itemCondition) {
        ItemConditionVo itemConditionVo = feignClient.itemByCondition(itemCondition);
        return itemConditionVo;
    }

    /**
     * 基本搜索功能
     * @param itemCondition
     * @return
     */
    @Override
    public PageDTO query(ItemCondition itemCondition) {
        PageDTO pageDTO = feignClient.pageQuery(itemCondition);
        return pageDTO;
    }
}




